package javaRMI;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.event.AncestorEvent;
import javax.swing.event.AncestorListener;

public class Frame {
	public static void main(String[] args) {
		new Frame().setFrame();
	}
	RegisterWithRMIServer server;
	public void setFrame(){
		JFrame frame=new JFrame("server");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setSize(500, 400);
		frame.setVisible(true);
		frame.setLayout(null);
		JButton start=new JButton("start");
		start.setBounds(100, 200, 100, 30);
		frame.add(start);
		start.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent arg0) {
				server = new RegisterWithRMIServer();	
			}
		});
		JButton end=new JButton("turn off");
		end.setBounds(250, 200, 100, 30);
		end.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				System.exit(0);
			}
		});
		frame.add(end);
	}
}
